package com.qyhl.webtv.module_broke.scoop.detail;


import com.qyhl.webtv.commonlib.entity.circle.ScoopListBean;

/**
 * Created by qyhl on 2017/12/13.
 */

public class ScoopDetailPresenter implements ScoopDetailContract.ScoopDetailPresenter {
    private ScoopDetailModel mModel;

    private ScoopDetailActivity mView;

    public ScoopDetailPresenter(ScoopDetailActivity mView) {
        this.mView = mView;
        this.mModel = new ScoopDetailModel(this);
    }

    @Override
    public void getDetail(String brokeId) {
        mModel.getDetail(brokeId);
    }

    @Override
    public void addAttention(String ID) {
        mModel.addAttention(ID);
    }

    @Override
    public void cancelAttention(String ID) {
        mModel.cancelAttention(ID);
    }

    @Override
    public void setDetail(ScoopListBean bean) {
        mView.setDetail(bean);
    }

    @Override
    public void setError(int code, String msg) {
        switch (code) {
            case 0:
                mView.setNetError(msg);
                break;
            case 1:
                mView.setError(msg);
                break;
            default:
                break;
        }
    }

    @Override
    public void addSuccess() {
        mView.addSuccess();
    }

    @Override
    public void addError(String msg) {
        mView.addError(msg);
    }

    @Override
    public void cancelSuccess() {
        mView.cancelSuccess();
    }

    @Override
    public void cancelError(String msg) {
        mView.cancelError(msg);
    }
}
